var ProfileModal = require('../models/profile');

module.exports = {
    create: (data) => {
        return new Promise((resolve, reject) => {
            ProfileModal.create(data, (error, doc) => {
                if (error) {
                    reject(error);
                } else {
                    resolve(doc);
                }
            });
        });
    },
    findOne: (data) => {
        return new Promise((resolve, reject) => {
            ProfileModal.findOne(data, (error, doc) => {
                if (error) {
                    reject(error);
                } else {
                    resolve(doc);
                }
            })
        });
    }
};
